package com.jie.netty.callback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;


/**
 * 确认回调函数
 */
@Slf4j
@Component
public class ConfirmCallbackService implements  RabbitTemplate.ConfirmCallback {
    
    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        if(ack) {
            log.info("消息投递成功");
        }else {
            log.info("消息投递错误");
        }
    }

}

